﻿using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using Ue.Infrastructure.Web.UI;
using Ue.Qcdz.Domain;
using Ue.Qcdz.Domain.Medias;
using Ue.Framework.Web.WebControls;
namespace Ue.Qcdz.UI.Controls.Medias
{
    public class MediasManger : SkinnedGridView
    {
        private string skinFileName = "~/Admin/Themes/Skins/Medias/MediaManger.ascx";
        #region Overrides of SkinnedControl



        protected override string GetSkinFileName()
        {
            return skinFileName;
        }
        protected override void InitializeSkin(System.Web.UI.Control skin)
        {

            base.InitializeSkin(skin);
        }
        #endregion

        #region Overrides of SkinnedGridView

        protected override void GridViewDataBind(object sender, EventArgs args)
        {
            IMediaRepository repository =
                       Ue.Infrastructure.RepositoryFramework.RepositoryFactory.GetRepository
                           <IMediaRepository, TheMedia>();
            IList<TheMedia> list = repository.FindBy();
            Repeater repeater = sender as Repeater;
            repeater.DataSource = list;
            repeater.DataBind();
        }

        #endregion
    }
}
